package demo19;

import demo18.Student;

/**
 * @author Huangjin
 * @version 1.0
 * describe:
 * @date 2023/3/9 18:28
 */
public class ThrowDemo {
    public static void main(String[] args) {
        demo18.Student zs = new Student();
        try {
            zs.setAge(200);
            System.out.println("此人的年龄为："+ zs.getAge()+"岁");
        }catch (RuntimeException e) {
            System.out.println("年龄不合法");
        }
    }
}
